home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 9666 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.7 KB

  1. Path: news1.h1.usa.pipeline.com!usenet
  2. From: grantp@usa.pipeline.com(Pete)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: How can I include IOSTREAM.H only once?
  5. Date: 3 Mar 1996 11:37:35 GMT
  6. Organization: Kalevi, Inc.
  7. Message-ID: <4hc09v$136@news1.usa.pipeline.com>
  8. References: <4hbi55$899@sam.inforamp.net>
  9. NNTP-Posting-Host: pipe9.h1.usa.pipeline.com
  10. X-PipeUser: grantp
  11. X-PipeHub: usa.pipeline.com
  12. X-PipeGCOS: (Pete)
  13. X-Newsreader: Pipeline v3.5.0
  14.  
  15. On Mar 03, 1996 07:36:16 in article <Re: How can I include IOSTREAM.H only
  16. once?>, 'rmorin@inforamp.net (Randy Charles Morin)' wrote: 
  17.  
  18.  
  19. >In article <4gre90$oei@service.polymtl.ca>, 
  20. >bluefox@info.polymtl.ca (Michael Gaudette) wrote: 
  21. >>I am presently engaged in what is usually called "the learning process", 
  22.  
  23. >>and I've been programming simple programs with classes.  Because of this,
  24.  
  25. >>I have had to #include <iostream.h> in most of my "class.cpp" files AND  
  26. >>in my main program. This (added to conio.h and all the other standard  
  27. >>libraries) usually result in a simple program being 20000 lines long. 
  28. >>Is there any way (using Borland v4.5) to make the compiler only link  
  29. >>those files ONCE? 
  30. >Tell the preprocessor to include the file only if it has not already been 
  31.  
  32. >included. 
  33. >#ifndef __IOSTREAM_H 
  34. >#include <iostream.h> 
  35. >#endif 
  36. >But, this can sometimes generate unexpected errors/warnings/bugs.  So make
  37.  
  38. >sure you know what you are doing when you use this technique. 
  39. I believe this answer is to a question other than the one asked. 
  40. There's no way to accomplish what the original poster wants to do, 
  41. although eader precompilation will ease the situation. 
  42.  
  43. -- 
  44. Pete Grant 
  45. Kalevi, Inc. 
  46. Software Engineering & development
  47.